//
//  ViewController.m
//  Sound Player
//
//  Created by iD Student on 7/9/13.
//  Copyright (c) 2013 Apple Inc. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad;


{
    [super viewDidLoad];
    NSURL *brl = [[NSBundle mainBundle] URLForResource:@"explosion" withExtension:@"mp3"];
    NSError *error;
    
    explosionSound = [[AVAudioPlayer alloc] initWithContentsOfURL: brl error: &error];
    if(error != nil)
    {
        //This happens when the sound cannot be loaded
        NSLog(@"Explosion sound could not be loaded!");
    }
    else
    {
        [explosionSound prepareToPlay];
    }
    if(error != nil)
    {
        //This happens when the sound cannot be loaded
        NSLog(@"Laser sound could not be loaded!");
    }
    else
    {
        [laserSound prepareToPlay];
    }

}


- (IBAction)explosionSound:(id)sender {
    [explosionSound play]; }


@end